Optimal. Leaf size=39 \[ \frac {(a-b) \cot (e+f x)}{f}+x (a-b)-\frac {a \cot ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3629, 12, 3473, 8} \[ \frac {(a-b) \cot (e+f x)}{f}+x (a-b)-\frac {a \cot ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 12
Rule 3473
Rule 3629
Rubi steps
\begin {align*} \int \cot ^4(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=-\frac {a \cot ^3(e+f x)}{3 f}-\int (a-b) \cot ^2(e+f x) \, dx\\ &=-\frac {a \cot ^3(e+f x)}{3 f}-(a-b) \int \cot ^2(e+f x) \, dx\\ &=\frac {(a-b) \cot (e+f x)}{f}-\frac {a \cot ^3(e+f x)}{3 f}-(-a+b) \int 1 \, dx\\ &=(a-b) x+\frac {(a-b) \cot (e+f x)}{f}-\frac {a \cot ^3(e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.04, size = 65, normalized size = 1.67 \[ -\frac {a \cot ^3(e+f x) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};-\tan ^2(e+f x)\right )}{3 f}-\frac {b \cot (e+f x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(e+f x)\right )}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.42, size = 49, normalized size = 1.26 \[ \frac {3 \, {\left (a - b\right )} f x \tan \left (f x + e\right )^{3} + 3 \, {\left (a - b\right )} \tan \left (f x + e\right )^{2} - a}{3 \, f \tan \left (f x + e\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.72, size = 106, normalized size = 2.72 \[ \frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 24 \, {\left (f x + e\right )} {\left (a - b\right )} - 15 \, a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 12 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + \frac {15 \, a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 12 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - a}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3}}}{24 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.59, size = 47, normalized size = 1.21 \[ \frac {b \left (-\cot \left (f x +e \right )-f x -e \right )+a \left (-\frac {\left (\cot ^{3}\left (f x +e \right )\right )}{3}+\cot \left (f x +e \right )+f x +e \right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.77, size = 46, normalized size = 1.18 \[ \frac {3 \, {\left (f x + e\right )} {\left (a - b\right )} + \frac {3 \, {\left (a - b\right )} \tan \left (f x + e\right )^{2} - a}{\tan \left (f x + e\right )^{3}}}{3 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 11.74, size = 40, normalized size = 1.03 \[ x\,\left (a-b\right )-\frac {\frac {a}{3}-{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (a-b\right )}{f\,{\mathrm {tan}\left (e+f\,x\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.71, size = 70, normalized size = 1.79 \[ \begin {cases} \tilde {\infty } a x & \text {for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\relax (e )}\right ) \cot ^{4}{\relax (e )} & \text {for}\: f = 0 \\a x + \frac {a}{f \tan {\left (e + f x \right )}} - \frac {a}{3 f \tan ^{3}{\left (e + f x \right )}} - b x - \frac {b}{f \tan {\left (e + f x \right )}} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________